package redis

import "strconv"

func SyncGoodsStock(goodsId, stock int) {

	key := "goods_stock:goods_id_" + strconv.Itoa(goodsId)
	for i := 0; i < stock; i++ {
		Rdb.LPush(key, goodsId)
	}
}

func GetGoodsStock(goodsId int) int64 {
	key := "goods_stock:goods_id_" + strconv.Itoa(goodsId)
	return Rdb.LLen(key).Val()
}
